//
//  main.cpp
//  类模板和向量
//
//  Created by Robin Guo on 2017/9/24.
//  Copyright © 2017年 Robin Guo. All rights reserved.
//

#include <iostream>
#include "queue.cpp"
#include "stack.cpp"
//#include "queue.hpp"

using namespace std;

class Point {
    float x;
    float y;
public:
    Point(float a=0,float b=0) {
        x = a;
        y = b;
    }
    
    void show() {
        cout << "x : " << x << " y = " << y << endl;
    }
};

int main(int argc, const char * argv[]) {
    
    stack<char> s;
    
    for (char i='a'; i<='z'; i++) {
        s.push(i);
    }

    printf("s size : %d\n",s.size());
    int size = s.size();
    
    for (int j=0; j<size;j++) {
        char ch = s.pop();
        printf("j = %d , %c\n",j,ch);
    }
    
    stack<Point> ps;
    Point p0(10,32);
    Point p1(23,34);
    Point p2(23,43);
    
    ps.push(p0);
    ps.push(p1);
    ps.push(p2);
    
    printf("ps size : %d\n",ps.size());
    
    
//    queue<char> q_ch;
//    queue<Point> q_p;
    
    // 如果没有实现继承的抽象类的所有虚函数，编译器会报错；
    queue<char> qs;
    for (char i='a'; i<='z'; i++) {
        qs.push(i);
    }
    
    int qsize = qs.size();
    for (int i=0; i<qsize; i++) {
        char ch = qs.pop();
        printf("ch : %c\n",ch);
    }
    
    queue<Point> qps;
    qps.push(p0);
    qps.push(p1);
    qps.push(p2);
    
    Point pp0 = ps.pop();
    pp0.show();
    
    Point qbsp = qps.pop();
    qbsp.show();
    
    return 0;
}
